#include "Shape.h"


class Rectangle :public Shape
{
public:
	double l, w;
	Rectangle(double a,double b):l(a),w(b){}
	double GetArea()
	{
		return w * l;
	}
	double GetPerimeter()
	{
		return w + w + l + l;
	}
};

class Circle :public Shape
{
public:
	double ra;
	Circle(double r):ra(r){}
	double GetArea()
	{
		return 3.14 * ra * ra;
	}
	double GetPerimeter()
	{
		return 2 * 3.14 * ra;
	}
};



Shape* Shape::createRectangle(double l, double w) { return new Rectangle(l, w); }
Shape* Shape::createCircle(double r) { return new Circle(r); }